#ifndef APPROXDECOMP_H
#define APPROXDECOMP_H

/********** Library Includes **************************************************/

#include <opencv/cv.h>
#include <opencv/highgui.h>

/********** Local Includes ****************************************************/

#include "blobdetector.h"
#include "robot_structures.h"

/********** Forward Class Declarations ****************************************/

class ImageSource;

/********** Classes ***********************************************************/

class ApproxDecomp{
public:
	/**
	 * Creates a new ApproxDecomp using the given ImageSource and open matrx .
	 */
	explicit ApproxDecomp(ImageSource *source, cv::Mat open);

    /**
	 * Returns an image with a grid overlayed.
	 */
	cv::Mat cellDecomp();
	
	int blockSize() const;
	
private:
	/**
	 * Retrieves the next frame from the ImageSource and blurs it.
	 */
	cv::Mat getAndBlur() const;
	

	    
private:
	/**
	 * The source from which to pull camera frames.
	 */
	ImageSource *m_source;
	
	/**
	 * The matrix of open and blocked locations.
	 */
	cv::Mat m_open;

};

#endif